data->name, data->visible ? "yes" : "NO", data->objid));
data->data = wpt = waypt_new();
-#if NEW_STRINGS
- wpt->shortname = QString::fromLatin1(data->name);
-#else
wpt->shortname = xstrdup(data->name);
-#endif
+
time = data->mtime;
if (! time) {
time = data->ctime;
}
if (*cend++) {
-#if NEW_STRINGS
- wpt->notes = QString::fromLatin1(cend);
-#else
wpt->notes = xstrdup(cend);
-#endif
}
if (wpt->HasUrlLink()) {
wpt->notes = xstrdup(str);
}
xfree(str);
-#if NEW_STRINGS
- if (!wpt->notes.isEmpty()) {
-#else
+
if (wpt->notes) {
-#endif
- DBG((sobj, "notes = \"%s\"\n", CSTRc(wpt->notes)));
+ DBG((sobj, "notes = \"%s\"\n", wpt->notes));
}
mmo_fillbuf(buf, 12, 1);
wpt->latitude = wpt2->latitude;
wpt->longitude = wpt2->longitude;
-#if NEW_STRINGS
- wpt->shortname = wpt2->shortname;
- wpt->description = wpt2->description;
- wpt->notes = wpt2->notes;
-#else
xfree(wpt->shortname);
wpt->shortname = xstrdup(wpt2->shortname);
+
if (wpt2->description) {
wpt->description = xstrdup(wpt2->description);
}
if (wpt2->notes) {
wpt->notes = xstrdup(wpt2->notes);
}
-#endif
if (wpt2->HasUrlLink()) {
UrlLink l = wpt2->GetUrlLink();
wpt->notes = xstrdup(l.url_.toUtf8().data());
static void
mmo_write_wpt_cb(const waypoint* wpt)
{
- char* str;
+ char* str, *cx;
int objid;
time_t time;
int icon = 0;
DBG(("write", "waypoint \"%s\"\n", wpt->shortname ? wpt->shortname : "Mark"));
objid = mmo_write_obj_head("CObjWaypoint",
-#if NEW_STRINGS
- wpt->shortname.isEmpty() ? "Mark" : CSTRc(wpt->shortname), time, obj_type_wpt);
-#else
(wpt->shortname && *wpt->shortname) ? CSTRc(wpt->shortname) : "Mark", time, obj_type_wpt);
-#endif
data = mmo_register_object(objid, wpt, wptdata);
data->refct = 1;
mmo_write_category("CCategory", (mmo_datatype == rtedata) ? "Waypoints" : "Marks");
str = xstrdup("");
}
- QString cx = wpt->notes;
+ cx = wpt->notes;
if (cx == NULL) {
cx = wpt->description;
}
tmp.is_html = 1;
cx = kml = strip_html(&tmp);
}
- str = xstrappend(str, CSTR(cx));
+ str = xstrappend(str, cx);
if (kml) {
xfree(kml);
}
}
objid = mmo_write_obj_head("CObjRoute",
-#if NEW_STRINGS
- rte->rte_name.isEmpty() ? "Route" : CSTRc(rte->rte_name), time, obj_type_rte);
-#else
(rte->rte_name && *rte->rte_name) ? CSTRc(rte->rte_name) : "Route", time, obj_type_rte);
-#endif
mmo_register_object(objid, rte, rtedata);
mmo_write_category("CCategory", "Route");
gbfputc(0, fout); /* unknown */
}
objid = mmo_write_obj_head("CObjTrack",
-#if NEW_STRINGS
- trk->rte_name.isEmpty() ? "Track" : CSTRc(trk->rte_name), gpsbabel_time, obj_type_trk);
-#else
(trk->rte_name && *trk->rte_name) ? CSTRc(trk->rte_name) : "Track", gpsbabel_time, obj_type_trk);
-#endif
mmo_write_category("CCategory", "Track");
gbfputuint16(trk->rte_waypt_ct, fout);
track_disp_all(mmo_write_trk_head_cb, mmo_write_trk_tail_cb, mmo_write_wpt_cb);
}
+/**************************************************************************/
ff_vecs_t mmo_vecs = {
ff_type_file,
CET_CHARSET_MS_ANSI, 0
};
+
+/**************************************************************************/
break;
case 2:
-#if NEW_STRINGS
- wpt->shortname = QString::fromLatin1(c);
-#else
wpt->shortname = xstrdup(c);
-#endif
break;
case 3:
snprintf(cdate, sizeof(cdate), "%02d/%02d/%04d", tm.tm_mon, tm.tm_mday, tm.tm_year);
snprintf(ctime, sizeof(ctime), "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec);
- QString sn;
switch (what) {
+ char* sn;
case STM_WAYPT:
case STM_RTEPT:
} else {
sn = mkshort(short_h, wpt->shortname);
}
- gbfprintf(fout, "WP,D,%s,", CSTR(sn));
+ gbfprintf(fout, "WP,D,%s,", sn);
+ xfree(sn);
break;
case STM_TRKPT: